package net.wofly.sale.order.service.impl;

import net.wofly.sale.order.domain.OrderType;
import net.wofly.sale.order.repository.OrderTypeRepository;
import net.wofly.sale.order.service.IOrderTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.List;

@Service("iOrderTypeService")
@Transactional
public class OrderTypeServiceImpl implements IOrderTypeService {
    
    @Autowired
    OrderTypeRepository orderTypeRepository;
    
    @Override
    public OrderType save(OrderType entity) {
        return orderTypeRepository.save(entity);
    }
    
    @Override
    public void delete(OrderType entity) {
        orderTypeRepository.delete(entity);
    }
    
    @Override
    public void delete(String key) {
        orderTypeRepository.delete(key);
    }
    
    @Override
    public OrderType findOne(String key) {
        return orderTypeRepository.findOne(key);
    }
    
    @Override
    public List<OrderType> save(List<OrderType> entityList) {
        return (List<OrderType>) orderTypeRepository.save(entityList);
    }
    
    @Override
    public List<OrderType> findByStatus(Integer status) {
        return orderTypeRepository.findByStatus(status);
    }
}
